﻿<%@ taglib prefix="s" uri="/struts-tags" %>
<s:include value="/layout/header.jsp" />
<SCRIPT language="javascript" src="js/jquery-1.2.6.js"></SCRIPT>
    <!-- For alternative headers END PASTE here -->

 
      <!-- B.1 MAIN CONTENT -->
      <div class="main-content">
        
        
<h1 class="pagetitle"><s:property value="activity.name"/></h1>
       
        <div class="column1-unit">
		<ul>
		
        <li>活动名称:<s:property value="activity.name"/></li>
		<li>活动时间:<s:property value="activity.starttime"/></li>
		<li>活动地点:<s:property value="activity.place"/></li>
		<li>活动所属:<s:property value="activity.organization.name"/></li>
		<li>活动描述:<br><s:property value="activity.description"/></li>

		</ul>
        <s:if test="isActor && isNewActivity">
		<ul>
            <li><a href="askForLeaveAcitivity.action?orgId=<s:property value="activity.organization.id"/>&activityId=<s:property value="activity.id"/>">请假</a></li>
		</ul>
        </s:if>
        <s:if test="isAdmin">
		<ul>
            <li><a href="sendMessageToActors.action?activityId=<s:property value="activity.id"/>">群发站内信</a></li>
        </ul>
        <ul>
            <li><a href="submitActivityNews.action?orgId=<s:property value="activity.organization.id"/>&activityName=<s:property value="activity.name"/>">发布活动公告</a></li>
		</ul>
        </s:if>
        <ul>
            <li><a href="viewComments.action?activityId=<s:property value='activity.id'/>&orgId=<s:property value="activity.organization.id"/>">查看活动留言板</a></li>
        </ul>
		<br>
        <s:if test="!isNewActivity">
		<h1 class="block">考勤表</h1>
         <table>
            <tr><th class="top" scope="col" width="70" align="center">姓名</th>
			<th class="top" scope="col" width="80" align="center">出席情况</th>
            <th class="top" scope="col" align="center">活动表现</th>
			<th class="top" scope="col" width="100">评分</th>
			</tr>
            <s:if test="useractrelations">
                    <s:iterator value="useractrelations">
                        <tr><th scope="row"><a href="userInfo.action?userId=<s:property value="user.id"/>"><s:property value="user.name"/></a></th>
                        <td><s:if test="state==0">缺席</s:if>
                            <s:elseif test="state==1">参加</s:elseif>
                            <s:else>请假</s:else></td>
                         <td><s:if test="isAdmin">
                             <p id="ssa<s:property value='user.id'/>"><s:property value='description'/></p>
                             <input id="a<s:property value='user.id'/>" type="button"  class="button" value="修改"/>
                             <input class="behavior" id="sa<s:property value='user.id'/>" type="text" size="40"/>
                        </s:if>
                        <s:else>
                            <s:property value='description'/>
                        </s:else></td>
                         <td>
                         <s:if test="isAdmin">
                             <font size="2" face="Verdana"><p id="sse<s:property value='user.id'/>" align="center"><s:property value='score'/></p></font>
                             <!--<input id="sse<s:property value='user.id'/>" type="text" maxlength="2" disabled="true" size="1" value="<s:property value='score'/>"/>-->
                             <input id="e<s:property value='user.id'/>" type="button"  class="button" value="修改"/>
                             <select class="score" id="se<s:property value='user.id'/>">
                                <option value="" selected="true">
                                <option value="A">A
                                <option value="B">B
                                <option value="C">C
                                <option value="D">D
                                <option value="E">E
                            </select>
                        </s:if>
                        <s:else>
                            <s:property value='score'/>
                        </s:else></td></tr>
                    </s:iterator>
            </s:if>
          </table>
          </s:if>
        </div>
		
        <hr class="clear-contentunit" />
      </div>
    <!-- C. FOOTER AREA -->

    <script type="text/javascript">
        $(document).ready(function(){
            $(".score").hide();
            $(".behavior").hide();
        });
        $(".score").change( function() {
            var selectId = $(this).attr("id");
            $.get("editScore.action",{degreeStr:$(this).val(),actorIdStr:$(this).attr("id"),activityId:<s:property value="activity.id"/>,orgId:<s:property value="activity.organization.id"/>},function(data){
                $("#s"+selectId).text(data);
                $("#"+selectId).fadeOut("normal");
            });
        });
        $(".behavior").change(function(){
            var selectId = $(this).attr("id");
            $.get("editBehavior.action",{behavior:$(this).val(),actorIdStr:$(this).attr("id"),activityId:<s:property value="activity.id"/>,orgId:<s:property value="activity.organization.id"/>},function(data){
                $("#s"+selectId).text(data);
                $("#"+selectId).fadeOut("normal");
            });
        })

        $("input[@type='button']").click( function() {
            $("#s"+$(this).attr("id")).fadeIn("normal");
        });
    </script>

   <s:include value="/layout/footer.jsp"/>
